package struts.actionForm.entreprise;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class BeanValiderCandidature extends ActionForm 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String idEtudiant=null;


	public String getIdEtudiant() 
	{
		return idEtudiant;
	}


	public void setIdEtudiant(String idEtudiant) 
	{
		this.idEtudiant = idEtudiant;
	}
	

	@Override
	public ActionErrors validate(ActionMapping mapping,	HttpServletRequest request)
	{
		request.getSession().setAttribute("message_candidature_valider",null);
		ActionErrors erreurs =new ActionErrors();
		if(getIdEtudiant()==null||"".equals(getIdEtudiant()))
		{
			erreurs.add("candidature_vide", new ActionMessage("ValiderStage.erreurs.SelectCandidatureRequis"));
		}
		return erreurs;
	}

}
